<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>4.1 基本类型和引用类型的值</title>
    <script>
        var num1 = 5;
        var num2 = num1;
        console.log(num1);
        console.log(num2);
        --num1;
        console.log(num1);
        console.log(num2);
        console.log('----------------------');
        let obj1 = new Object({name: '复制引用类型的值'});
        let obj2 = obj1;

        console.log(obj2.name);
        obj2.name = '我改变了都改变';
        console.log(obj1.name);
        console.log(obj2.name);

        console.log('----------------------');

        function info(obj) {
            obj.name = '雨夜';
            obj = new Object();
            obj.name = '寂寞';
            console.log(obj);
        }

        let person = new Object();
        info(person);
        console.info(person);
    </script>
</head>
<body>

</body>
</html>